<%@page isELIgnored="false" pageEncoding="UTF-8" contentType="text/html; UTF-8" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/layui/css/layui.css"/>
    <script type="text/javascript" src="${pageContext.request.contextPath}/layui/layui.js"></script>
</head>
<body>
<div id="categoryTree"></div>
<script type="text/javascript">
    layui.use("tree",function(){
        var tree = layui.tree;
        var $ = layui.jquery;

        $.ajax({
            "url":"${pageContext.request.contextPath}/pmsCategories",
            "type":"get",
            "dataType":"json",
            "success":function(result){
                console.log(result);
                tree.render({
                    elem:"#categoryTree",
                    data:result.data
                });
            }
        })

    })
</script>

</body>
</html>